package com.gz.furnitures.dao.impl;

import com.gz.furnitures.dao.AdminDao;
import com.gz.furnitures.dao.BasicDao;
import com.gz.furnitures.entity.Admin;

public class AdminDaoImpl extends BasicDao<Admin> implements AdminDao {
    @Override
    public Admin queryAdminByName(String username) {
        String sql = "select * from admin where username = ?";
        Admin admin = querySingle(sql, Admin.class, username);
        return admin;
    }

    @Override
    public Admin queryAdminByNameAndPassword(String username, String password) {
        String sql = "select * from admin where username = ? and password = MD5(?)";
        Admin admin = querySingle(sql, Admin.class, username, password);
        return admin;
    }
}
